GXSetPathParts
You can use theGXSetPathParts
function to replace a range of geometric points in the geometry of a path shape with the information from a specifiedgxPaths
structure.
void GXSetPathParts(gxShape target, long index, long count, const gxPaths *data, gxEditShapeFlag flags);
target
- A reference to the path shape whose geometry you want to edit.
index
- The index number of the first geometric point to replace. A value of 0 indicates that the new information should be inserted after the final geometric point in the target shape's geometry.
count
- The number of the geometric points to replace. A value of 0 indicates that no geometric points should be replaced; instead, the new information is inserted before the geometric point specified by the
index
parameter. If you pass thegxSelectToEnd
constant for this parameter, all geometric points from the one specified by theindex
parameter to the final geometric point are replaced.data
- A pointer to the
gxPaths
structure containing the new geometry information.flags
- A set of flags that determine how the new information is inserted in the existing geometry.
DESCRIPTION
TheGXSetPathParts
function replaces geometry information in the target shape's geometry with the information pointed to by thedata
parameter. Theindex
andcount
parameters determine what part of the original geometry is replaced. Theflags
parameter determines how the new information is inserted in the geometry.The
data
parameter contains a pointer to the geometry information to be copied into the target shape's geometry. If you pass thegxSetToNil
constant for this parameter, no new information is copied in; in this case, theGXSetPathParts
function removes the indicated geometric points instead of replacing them.The
index
parameter indicates the first geometric point to be replaced. If you pass a value of 0 for this parameter, no geometric points are replaced. Instead, this function inserts the new geometric information after the last geometric point of the target shape's original geometry. If you pass 0 for this parameter, you must pass 0 or thegxSelectToEnd
constant for thecount
parameter.The
count
parameter indicates how many geometric points in the original geometry should be replaced. If you pass a value of 0 for this parameter, no geometric points are replaced; instead, this function inserts the new geometry information before the geometric point indicated by theindex
parameter. If you pass thegxSelectToEnd
constant for this parameter, the function replaces all geometric points in the original geometry starting with the one indicated by theindex
parameter.When this function inserts the new geometric information, it retains the contour breaks contained in the
gxPaths
structure specified in thedata
parameter. For example, if you provide agxPaths
structure that contains two contours, the break between those contours remains when the geometric points are inserted into the target shape's geometry.The
flags
parameter indicates how you want the function to merge the first geometric point and the last geometric point of thegxPaths
structure into the target shape's geometry. The possible flags are
gxBreakNeitherEdit = 0 gxBreakLeftEdit = 0x01 gxBreakRightEdit = 0x02 gxRemoveDuplicatePoints = 0x04ThegxBreakNeitherEdit
value indicates that the first geometric point of thegxPaths
structure should be merged into the preceding contour of the target shape's geometry and the final geometric point of thegxPaths
structure should be merged into the subsequent contour.The
gxBreakLeftEdit
flag indicates that the first geometric point of thegxPaths
structure should begin a new contour once inserted in the target shape's geometry. ThegxBreakRightEdit
flag indicates that the geometric point in the target shape that follows the final geometric point of thegxPaths
structure (after the new information is inserted) should begin a new contour.The
gxRemoveDuplicatePoints
flag indicates that this function should, when inserting the information from thegxPaths
structure, remove the first geometric point of this inserted structure if it exactly matches the preceding point in the existing geometry. Similarly, this flag indicates that the final geometric point of thegxPaths
structure should be removed if it exactly matches the subsequent geometric point in the target shape's geometry.ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil number_of_points_exceeds_implementation_limit number_of_contours_exceeds_implementation_limit size_of_polygon_exceeds_implementation_limit illegal_type_for_shape (debugging version) inconsistent_parameters (debugging version) index_is_less_than_zero (debugging version) count_is_less_than_zero (debugging version) shape_access_not_allowed (debugging version) Warnings index_out_of_range count_out_of_range SEE ALSO
For an example that uses this function, see "Editing Paths Parts" beginning on page 2-91.For a discussion of paths, see "Path Shapes" on page 2-25.
For the definition of the
gxPaths
structure, see "Path Structures" on page 2-107.For information about other functions that allow you to edit information in shape geometries, see the description of the
GXSetShapePoints
function on page 2-142 and the description of theGXSetShapeParts
function on page 2-154.To copy parts of a path shape's geometry, use the
GXGetPathParts
function, which is described on page 2-148.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help